/**
 * This program is free software but WITHOUT ANY WARRANTY OR CONDITIONS OF ANY KIND.
 *
 * Copyright (C) 2011-2012 www.pretty-tools.com
 */

chrome.browserAction.onClicked.addListener(function(tab) {
    var href = tab.url;
    var url = 'http://vk.com/share.php?url='+encodeURIComponent(href);
    var wnd = window.open("", "_blank", "top=" + ((screen.height / 2) - (200)) + ",left=" + ((screen.width / 2) - (300)) + ",width=600,height=400,resizable=1");
    wnd.location.href = url;
});

if ("false" != localStorage["isFirstStart"]) {
    window.open("http://vkontakte.pretty-tools.com/installed_for_chrome.php", "_blank");
    localStorage["isFirstStart"] = "false";
}
